function assignCustomItemsNets()
--------------------------------------------------------------------------------------------------------------
--PLACE CUSTOM ASSIGNMENTS BELOW HERE
--------------------------------------------------------------------------------------------------------------




--------------------------------------------------------------------------------------------------------------
--PLACE CUSTOM ASSIGNMENTS ABOVE HERE
--------------------------------------------------------------------------------------------------------------
end

--------------------------------------------------------------------------------------------------------------

function GoalNetUpdate(idx)
	local as = gSportsRNA
	local goalnet = as:GetTable("wvGoalNet", idx)

    db.goalnet[idx].lightType = as:GetInt(goalnet, "stadLightType")
	db.goalnet[idx].stadiumID = as:GetInt(goalnet, "stadID")
	db.goalnet[idx].prefix = as:GetString(goalnet, "stadNamePrefix")

	db.goalnet[idx].netID = as:GetInt(goalnet, "netTexture") 
	db.goalnet[idx].netColorID = as:GetInt(goalnet, "colorTexture") 
	db.goalnet[idx].goalType = as:GetInt(goalnet, "goalType") 
	
	
	--assignCustomItemsNets()
	
	local netidx = math.floor(idx/2)
	
	local stadium = as:GetTable("wvStadium", netidx)
	db.stadium[netidx].homeKitTeamID = as:GetInt(stadium, "homeKitTeamID" )
	
	db.goalnet[idx].netID = getNetStyle(db.stadium[netidx].homeKitTeamID,db.goalnet[idx].netID)
	db.goalnet[idx].netColorID = getNetColour(db.stadium[netidx].homeKitTeamID,db.goalnet[idx].netColorID)
	
end

function GoalNetAssetBind(goalnet)
	local gr = gRenderables
   	local lod = 0

	gr:AddCallback(goalnet, lod, "GoalNetUpdate(?)")
	gr:AddAsset(goalnet, lod, "shader", "data/fifarna/shader.big")
	gr:AddAsset(goalnet, lod, "nettexture", "data/sceneassets/goalnet/goalnet_${db.goalnet[?].netID}.rx3")
	gr:AddAsset(goalnet, lod, "colortexture", "data/sceneassets/goalnet/netcolor_${db.goalnet[?].netColorID}_textures.rx3")
	gr:AddAsset(goalnet, lod, "stadium", "data/sceneassets/stadium/${db.goalnet[?].prefix}_${db.goalnet[?].stadiumID}_${db.goalnet[?].lightType}_container_0.rx3")

	gr:AddAsset(goalnet, lod, "goalbase_textures", "data/sceneassets/goalnet/goalpost_${db.goalnet[?].goalType}_textures.rx3")
--	gr:SetTexture(goalnet, lod, "netmesh", "textures", "netTexture", "nettexture", "goalnet_${db.goalnet[?].netColorID}_cm.Raster")
--	gr:SetTexture(goalnet, lod, "netmesh", "textures", "colorTexture", "colortexture", "goalnet_color.Raster")

	local part = "goalbase_static"
	gr:AddAsset(goalnet, lod, part, "data/sceneassets/goalnet/goalpost_${db.goalnet[?].goalType}.rx3")
	gr:CreateMaterialFromAttribulator(goalnet, lod, part, "goalbase_material", "goalbase" )
	gr:SetSubMesh(goalnet, lod, part, "goalpost_static")
	gr:SetTexture(goalnet, lod, part, "textures", "diffuseTexture", "goalbase_textures", "goalbase_cm")
	gr:SetTextureFromRuntime(goalnet, lod, part, "textures", "coverageMap", "covmap_${db.goalnet[?].stadiumID}_${db.goalnet[?].lightType}")
	
	local part = "goalbase_slide"
	gr:AddAsset(goalnet, lod, part, "data/sceneassets/goalnet/goalpost_${db.goalnet[?].goalType}.rx3")
	gr:CreateMaterialFromAttribulator(goalnet, lod, part, "goalbase_material", "goalbase" )
	gr:SetSubMesh(goalnet, lod, part, "goalpost_slide")
	gr:SetTexture(goalnet, lod, part, "textures", "diffuseTexture", "goalbase_textures", "goalbase_cm")
	gr:SetTextureFromRuntime(goalnet, lod, part, "textures", "coverageMap", "covmap_${db.goalnet[?].stadiumID}_${db.goalnet[?].lightType}")
	
	

	return goalnet
end



netStyle = {}
netColour = {}

function assignNet(team,style,colour)
netStyle[team] = style
netColour[team] = colour
end

function getNetStyle(team,style)

if (netStyle[team] ~= nil) then
return netStyle[team]
else
return style
end

end

function getNetColour(team,colour)

if (netColour[team] ~= nil) then
return netColour[team]
else
return colour
end

end


assignCustomItemsNets()

--Revolution Mod 13 1.0
--Edited by scouser09